// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_hm_messages
// * CreateDate    : 2014-06-05 18:29:59
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:29:59
// * LastChanger   : 2014-06-05 18:29:59
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class HmMessagesEntity : EntityBase
    {
        public HmMessagesTable TableSchema
        {
            get
            {
                return HmMessagesTable.Current;
            }
		}
		
		public HmMessagesEntity()
        {

        }
		
		public HmMessagesEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Messageid = Convert.ToInt64(CommonFunctions.ToObject(dr["messageid"]));
			this.Messageaccountid = Convert.ToInt32(CommonFunctions.ToObject(dr["messageaccountid"]));
			this.Messagefolderid = Convert.ToInt32(CommonFunctions.ToObject(dr["messagefolderid"]));
			this.Messagefilename = Convert.ToString(CommonFunctions.ToObject(dr["messagefilename"]));
			this.Messagetype = Convert.ToByte(CommonFunctions.ToObject(dr["messagetype"]));
			this.Messagefrom = Convert.ToString(CommonFunctions.ToObject(dr["messagefrom"]));
			this.Messagesize = Convert.ToInt64(CommonFunctions.ToObject(dr["messagesize"]));
			this.Messagecurnooftries = Convert.ToInt32(CommonFunctions.ToObject(dr["messagecurnooftries"]));
			this.Messagenexttrytime = Convert.ToDateTime(CommonFunctions.ToObject(dr["messagenexttrytime"]));
			this.Messageflags = Convert.ToByte(CommonFunctions.ToObject(dr["messageflags"]));
			this.Messagecreatetime = Convert.ToDateTime(CommonFunctions.ToObject(dr["messagecreatetime"]));
			this.Messagelocked = Convert.ToByte(CommonFunctions.ToObject(dr["messagelocked"]));
			this.Messageuid = Convert.ToInt64(CommonFunctions.ToObject(dr["messageuid"]));
        }
		
		public HmMessagesEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Messageid = Convert.ToInt64(CommonFunctions.ToObject(dr["messageid"]));
			this.Messageaccountid = Convert.ToInt32(CommonFunctions.ToObject(dr["messageaccountid"]));
			this.Messagefolderid = Convert.ToInt32(CommonFunctions.ToObject(dr["messagefolderid"]));
			this.Messagefilename = Convert.ToString(CommonFunctions.ToObject(dr["messagefilename"]));
			this.Messagetype = Convert.ToByte(CommonFunctions.ToObject(dr["messagetype"]));
			this.Messagefrom = Convert.ToString(CommonFunctions.ToObject(dr["messagefrom"]));
			this.Messagesize = Convert.ToInt64(CommonFunctions.ToObject(dr["messagesize"]));
			this.Messagecurnooftries = Convert.ToInt32(CommonFunctions.ToObject(dr["messagecurnooftries"]));
			this.Messagenexttrytime = Convert.ToDateTime(CommonFunctions.ToObject(dr["messagenexttrytime"]));
			this.Messageflags = Convert.ToByte(CommonFunctions.ToObject(dr["messageflags"]));
			this.Messagecreatetime = Convert.ToDateTime(CommonFunctions.ToObject(dr["messagecreatetime"]));
			this.Messagelocked = Convert.ToByte(CommonFunctions.ToObject(dr["messagelocked"]));
			this.Messageuid = Convert.ToInt64(CommonFunctions.ToObject(dr["messageuid"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HmMessagesTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public long Messageid
        {
            get { return Convert.ToInt64(GetData(HmMessagesTable.C_messageid)); }
            set { SetData(HmMessagesTable.C_messageid, value); }
        }
		
        [DataMember]
        public int Messageaccountid
        {
            get { return Convert.ToInt32(GetData(HmMessagesTable.C_messageaccountid)); }
            set { SetData(HmMessagesTable.C_messageaccountid, value); }
        }
		
        [DataMember]
        public int Messagefolderid
        {
            get { return Convert.ToInt32(GetData(HmMessagesTable.C_messagefolderid)); }
            set { SetData(HmMessagesTable.C_messagefolderid, value); }
        }
		
        [DataMember]
        public string Messagefilename
        {
            get { return Convert.ToString(GetData(HmMessagesTable.C_messagefilename)); }
            set { SetData(HmMessagesTable.C_messagefilename, value); }
        }
		
        [DataMember]
        public byte Messagetype
        {
            get { return Convert.ToByte(GetData(HmMessagesTable.C_messagetype)); }
            set { SetData(HmMessagesTable.C_messagetype, value); }
        }
		
        [DataMember]
        public string Messagefrom
        {
            get { return Convert.ToString(GetData(HmMessagesTable.C_messagefrom)); }
            set { SetData(HmMessagesTable.C_messagefrom, value); }
        }
		
        [DataMember]
        public long Messagesize
        {
            get { return Convert.ToInt64(GetData(HmMessagesTable.C_messagesize)); }
            set { SetData(HmMessagesTable.C_messagesize, value); }
        }
		
        [DataMember]
        public int Messagecurnooftries
        {
            get { return Convert.ToInt32(GetData(HmMessagesTable.C_messagecurnooftries)); }
            set { SetData(HmMessagesTable.C_messagecurnooftries, value); }
        }
		
        [DataMember]
        public DateTime Messagenexttrytime
        {
            get { return Convert.ToDateTime(GetData(HmMessagesTable.C_messagenexttrytime)); }
            set { SetData(HmMessagesTable.C_messagenexttrytime, value); }
        }
		
        [DataMember]
        public byte Messageflags
        {
            get { return Convert.ToByte(GetData(HmMessagesTable.C_messageflags)); }
            set { SetData(HmMessagesTable.C_messageflags, value); }
        }
		
        [DataMember]
        public DateTime Messagecreatetime
        {
            get { return Convert.ToDateTime(GetData(HmMessagesTable.C_messagecreatetime)); }
            set { SetData(HmMessagesTable.C_messagecreatetime, value); }
        }
		
        [DataMember]
        public byte Messagelocked
        {
            get { return Convert.ToByte(GetData(HmMessagesTable.C_messagelocked)); }
            set { SetData(HmMessagesTable.C_messagelocked, value); }
        }
		
        [DataMember]
        public long Messageuid
        {
            get { return Convert.ToInt64(GetData(HmMessagesTable.C_messageuid)); }
            set { SetData(HmMessagesTable.C_messageuid, value); }
        }
		
		#endregion
	}
	
	
}	

